Skip to content

fix(desktop): let a provider-backed agent be restarted after shutdown - #7072

Open
renatobardi wants to merge 1 commit into
block:mainfrom
renatobardi:fix/provider-agent-restart-after-shutdown
Open

fix(desktop): let a provider-backed agent be restarted after shutdown#7072
renatobardi wants to merge 1 commit into
block:mainfrom
renatobardi:fix/provider-agent-restart-after-shutdown

Conversation

@renatobardi

Copy link
Copy Markdown

Summary

The profile panel's Restart affordance was gated to backend.type === "local", but a provider agent's status is a control-plane fact (runtime.rs's two-axis model: "the provider was invoked") that stays "deployed" forever once set — there is no v1 undeploy. It never reverts after !shutdown takes the harness offline, so once a provider-backed agent went offline it had no way back through the UI: the primary action stayed permanently wired to resend !shutdown, never reaching start again.

respawnManagedAgentWithRules already handles provider backends correctly (skips the stop step, calls start directly), so the local-only gate on onAgentRestart was just an unnecessary restriction — isManagedAgentActive is already backend-agnostic. Drop the extra check and use it directly.

Related issue

None found.

Testing

  • Added unit tests pinning isManagedAgentActive as backend-agnostic (deployed provider agent / running local agent / never-deployed provider agent / stopped local agent).
  • pnpm exec tsc --noEmit clean.
  • pnpm exec biome check clean.
  • Full agents/profile/channels feature test suites: 2025/2025 passing.
  • Found while debugging a real deploy: a provider-backed agent (a third-party backend implementing the docs/remote-agents.md contract) shut down via !shutdown showed no way to restart it from the Buzz Desktop UI, even after quitting and reopening the app.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

@renatobardi
renatobardi requested a review from a team as a code owner August 31, 2026 00:39
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 3c7f288c60d67df78577b237e27c3dfc8831aaa1...e7fd453c5be10e590b7a600ba08b9131a99aa5ed.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review e7fd453c5be10e590b7a600ba08b9131a99aa5ed to authorize a new review.
Any previous review applies only to its recorded range.

The profile panel's Restart affordance was gated to
`backend.type === "local"`, but a provider agent's `status` is a
control-plane fact (runtime.rs's two-axis model: "the provider was
invoked") that stays "deployed" forever once set — there is no v1
undeploy. It never reverts after `!shutdown` takes the harness offline,
so once a provider agent went offline it had no way back: the primary
action stayed permanently wired to resend `!shutdown`, never `start`.

respawnManagedAgentWithRules already handles provider backends
correctly (skips the stop step, calls start directly), so the local-only
gate was just an unnecessary restriction — isManagedAgentActive is
already backend-agnostic. Drop the extra check and use it directly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Renato Bardi <renato.bardi@outlook.com>
@renatobardi
renatobardi force-pushed the fix/provider-agent-restart-after-shutdown branch from a4a4daa to e7fd453 Compare September 7, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant